import request from '@/utils/request';
import type { BaseBeanModel, ResponsePageData, ResponseBaseData, QueryParamModel } from '@/api/model/baseModel';
const basePath = '/appsys/ConnectCenter/AppSoapWebServiceRest';
/** 单表 */
export interface SysSoapWebServiceDTo extends BaseBeanModel {
  /** 名称 */
  id?: any;
  /** 名称 */
  name?: any;
  /** 认证方式 */
  authType?: any;
  /** 用户 */
  user?: any;
  /** 口令 */
  password?: any;
  /** 端口 */
  wsinterface?: any;
  /** WSDL UR */
  wsdlurl?: any;
  /** 操作 */
  classId?: any;
  method?: any;
  soapVersion?: any;
  soapAction?: any;
  paramList?: any;
}
/**
 * 获取分页数据
 * @param param 表格参数
 * @param id 树节点id
 * @returns 表格数据
 */
export function listSysSoapWebServicePage(
  param: QueryParamModel,
  id: string
): Promise<ResponsePageData<SysSoapWebServiceDTo>> {
  return request.post(`${basePath}/searchByPage/${id}/v1`, param);
}

/**
 * 根据id加载数据
 * @param id 选中行id
 * @returns 表单数据
 */
export function getSysSoapWebService(id: string): Promise<ResponseBaseData<SysSoapWebServiceDTo>> {
  return request.get(`${basePath}/get/${id}/v1`);
}

/**
 * 保存表单数据
 * @param form 表单数据
 */
export function saveSysSoapWebService(form: SysSoapWebServiceDTo): Promise<ResponseBaseData<any>> {
  return request.post(`${basePath}/insertSoapWebService/v1`, form);
}

/**
 * 编辑保存表单数据
 * @param form 编辑表单数据
 */
export function editSaveSysSoapWebService(form: SysSoapWebServiceDTo): Promise<ResponseBaseData<any>> {
  return request.post(`${basePath}/updateSoapWebService/v1`, form);
}

/**
 * 根据id集合删除数据
 * @param ids 选中行id集合
 */
export function delSysSoapWebService(ids: [string]): Promise<ResponseBaseData<any>> {
  return request.delete(`${basePath}/deleteSoapWebServiceByIds/v1`, { data: ids });
}

/**
 * URL解析
 * @param param 解析参数
 * @returns 解析结果
 */
export function resolveWsdlUrlParam(param) {
  return request.get(`${basePath}/resolveWsdlUrl/v1`, { data: param });
}

/**
 * 端口解析
 * @param param 解析参数
 * @returns 解析结果
 */
export function resolveWsdlMethodParam(param) {
  return request.get(`${basePath}/resolveWsdlMethod/v1`, { data: param });
}

/**
 * 操作解析
 * @param param 解析参数
 * @returns 解析结果
 */
export function resolveWsdlParamParam(param) {
  return request.get(`${basePath}/resolveWsdlMethod/v1`, { data: param });
}

/**
 * 连接测试
 * @param param 连接参数
 * @param id 选中的id
 */
export function testSoapWebServicePara(param: any, id: string): Promise<ResponseBaseData<any>> {
  return request.post(`${basePath}/testSoapWebServicePara/${id}/v1`, param);
}
